<template>
  <div>
    <div class="title">
      <h3>送恋人/爱情花</h3>
      <div class="items">
        <div class="item" @click='clickItem(item.id)' v-for="item in items" :key="item.id">
          <img
            v-lazy="item.pic"
            class="item-pic"
            alt=""
            />
          <div class="item-info">
            <h5>{{item.name}}</h5>
            <div class="item-price">
              <p class="price">￥{{item.minPrice}}</p>
              <van-icon @click.stop="clickStop(item.id)" name="gouwuche" class-prefix="icon" color="#ff734c" size='30'/>
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  props: {
    items: {
      type: Array,
      required: true
    }
  },
  methods: {
    clickItem (id) {
      this.$emit('clickItem', id)
    },
    clickStop (id) {
      this.$emit('clickAdd', id)
    }
  }
}
</script>

<style lang="scss" scoped>
.title {
  color: #232628;
  font-size: 14px;
  text-align: center;
  margin: 10px 0;
  .items {
    padding: 0 8px;

    .item {
      display: flex;
      background-color: #fff;
      border-radius: 0.25rem;
    margin-bottom:10px;
    overflow: hidden;
      img {
        width: 4.525rem;
        height: 4.925rem;
      }
      .item-info {
        flex: 1;
           padding:0 10px;
        h5 {
          margin: 0;
          color: #333;
          font-size: 16px;
          line-height: 40px;
          margin-bottom: 100px;
        }

        .item-price {
          display: flex;
           color: #ff4437;
        font-size: 17px;
        justify-content: space-between;
        align-items: center;
        p{
            margin:0;
        }
        }
      }
    }
  }
}
</style>
